package nickthissen.iracing.parsing;

import org.jsoup.nodes.Element;
import org.jsoup.nodes.Node;


// Predicate to filter a list of Nodes to return only Element nodes with a matching name
public class FilterElementPredicate extends FilterNodeTypePredicate
{
	private String name;
	
	public FilterElementPredicate(String name) 
	{
		super(Element.class);
	}
	
	@Override
	public boolean apply(Node in)
	{
		if (super.apply(in))
		{
			Element e = (Element)in;
			return e.nodeName().equals(name);
		}
		return false;
	}
}
